package com.cn.dream_order_server.util;

public class Test01 {
    public static void main(String[] args) {
        MyCacheUtil cacheUtil = new MyCacheUtil();
        cacheUtil.set("1", "abc");
        cacheUtil.set("2", "bcd", 5);
        cacheUtil.set("3", "cde", 10);

        System.out.println("暂停5秒之后获取缓存1" + cacheUtil.get("1"));
        System.out.println("暂停5秒之后获取缓存2" + cacheUtil.get("2"));
        System.out.println("暂停5秒之后获取缓存3" + cacheUtil.get("3"));
        try {
            Thread.sleep(5 * 1000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        System.out.println("暂停10秒之后获取缓存1" + cacheUtil.get("1"));
        System.out.println("暂停10秒之后获取缓存2" + cacheUtil.get("2"));
        System.out.println("暂停10秒之后获取缓存3" + cacheUtil.get("3"));
        try {
            Thread.sleep(5 * 1000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        System.out.println("暂停15秒之后获取缓存1" + cacheUtil.get("1"));
        System.out.println("暂停15秒之后获取缓存2" + cacheUtil.get("2"));
        System.out.println("暂停15秒之后获取缓存3" + cacheUtil.get("3"));
    }
}
